
*		********************************************************************************		*
*		********************************************************************************		*
*		  File:				main.do																*
*		  Date:				Apr 2020															*
*		  Authors:			MG, NS																*
*		  Purpose:			Political Exclusion, Lost Autonomy, and Escalating Conflict over SD *
*							Forthcoming in International Organization							*
*		  Stata version:	14																	*
*		********************************************************************************		*
*		********************************************************************************		*




* Set directory
cd "...\Replication files"

* Open data set
use "GS_grievances_escalation.dta", replace

* Macros
global controls1 = "i.geo_concentrated groupsize i.lsepkin_adjregbase1 i.regaut lnlrgdpcap lnltotpop lv2x_polyarchy i.lfederal numb_rel_grps i.coldwar"
global controls2 = "groupsize i.lsepkin_adjregbase1 i.regaut i.lgiantoilfield mounterr i.noncontiguous lnlrgdpcap lnltotpop lv2x_polyarchy i.lfederal numb_rel_grps i.coldwar"
global tclaim = "c.t_claim c.t_claim#c.t_claim c.t_claim#c.t_claim#c.t_claim"
global tescal = "c.t_escal c.t_escal#c.t_escal c.t_escal#c.t_escal#c.t_escal"

 
 
 
 
**********
** TABLE 1
**********

tab status_excl nviol_sdm_onset if isrelevant == 1 & exclacc == 0, row
tab lost_autonomy nviol_sdm_onset if isrelevant == 1 & exclacc == 0, row
tab downgr2_incl nviol_sdm_onset if isrelevant == 1 & exclacc == 0, row chi2 // Chi2-test is reported in text
tab downgr2_aut nviol_sdm_onset if isrelevant == 1 & exclacc == 0, row

 
 
 
 
**********
** TABLE 2
**********


* Model 1
logit nviol_sdm_onset i.status_excl i.lost_autonomy $controls1 i.region_id $tclaim if isrelevant == 1 & exclacc == 0, cl(countries_gwid) nolog
	* Predicted probabilities reported in text
	margins i.status_excl i.lost_autonomy i.geo_concentrated i.lsepkin_adjregbase1, vsquish noatlegend

* Model 2
reg nviol_sdm_onset i.status_excl i.lost_autonomy $controls1 i.countries_gwid $tclaim if isrelevant == 1 & exclacc == 0, cl(countries_gwid)

* Model 3	
logit nviol_sdm_onset i.status_excl i.lost_autonomy $controls2 i.region_id $tclaim if isrelevant == 1 & exclacc == 0 & geo_concentrated == 1, cl(countries_gwid) nolog

* Model 4
reg nviol_sdm_onset i.status_excl i.lost_autonomy $controls2 i.countries_gwid $tclaim if isrelevant == 1 & exclacc == 0 & geo_concentrated == 1, cl(countries_gwid)

* Model 5
logit nviol_sdm_onset i.downgr2_incl i.downgr2_aut $controls1 i.region_id $tclaim if isrelevant == 1 & exclacc == 0, cl(countries_gwid) nolog
	* Predicted probabilities reported in text
	margins i.downgr2_aut, vsquish noatlegend

* Model 6
reg nviol_sdm_onset i.downgr2_incl i.downgr2_aut $controls1 i.countries_gwid $tclaim if isrelevant == 1 & exclacc == 0, cl(countries_gwid)

* Model 7
logit nviol_sdm_onset i.downgr2_incl i.downgr2_aut $controls2 i.region_id $tclaim if isrelevant == 1 & exclacc == 0 & geo_concentrated == 1, cl(countries_gwid) nolog

* Model 8
reg nviol_sdm_onset i.downgr2_incl i.downgr2_aut $controls2 i.countries_gwid $tclaim if isrelevant == 1 & exclacc == 0 & geo_concentrated == 1, cl(countries_gwid)

	
	
	
**********
** TABLE 3
**********

tab status_excl firstescal, row
tab lost_autonomy firstescal, row
tab downgr2_incl firstescal, row
tab downgr2_aut firstescal, row
	
tab status_excl escal, row
tab lost_autonomy escal, row
tab downgr2_incl escal, row
tab downgr2_aut escal, row	
	
	
	
	
	
**********
** TABLE 4
**********

* Model 1
logit firstescal i.status_excl i.lost_autonomy $controls2 i.region_id $tescal if geo_concentrated == 1, cl(countries_gwid) nolog
	* Predicted probabilities reported in text
	margins i.status_excl, vsquish noatlegend
	margins , at((p25) lnlrgdpcap) at((p75) lnlrgdpcap)

* Model 2
reg firstescal i.status_excl i.lost_autonomy $controls2 i.countries_gwid $tescal if geo_concentrated == 1, cl(countries_gwid)

* Model 3
logit firstescal i.downgr2_incl i.downgr2_aut $controls2 i.region_id $tescal if geo_concentrated == 1, cl(countries_gwid) nolog
	* Predicted probabilities reported in text
	margins i.downgr2_aut, vsquish noatlegend
	
* Model 4
reg firstescal i.downgr2_incl i.downgr2_aut $controls2 i.countries_gwid $tescal if geo_concentrated == 1, cl(countries_gwid)
		
* Model 5
logit escal i.status_excl i.lost_autonomy $controls2 i.region_id $tescal if geo_concentrated == 1, cl(countries_gwid) nolog
	* Predicted probabilities reported in text
	margins i.status_excl, vsquish noatlegend
	margins , at((p25) lnlrgdpcap) at((p75) lnlrgdpcap)
	
* Model 6
reg escal i.status_excl i.lost_autonomy $controls2 i.countries_gwid $tescal if geo_concentrated == 1, cl(countries_gwid)
	
* Model 7
logit escal i.downgr2_incl i.downgr2_aut $controls2 i.region_id $tescal if geo_concentrated == 1, cl(countries_gwid) nolog
	* Predicted probabilities reported in text
	margins i.downgr2_aut, vsquish noatlegend
	
* Model 8
reg escal i.downgr2_incl i.downgr2_aut $controls2 i.countries_gwid $tescal if geo_concentrated == 1, cl(countries_gwid)

